#include <iostream>
using namespace std;

class A 
{
public:
	A(int m1=0,double m2=0.00):m1_(m1),m2_(m2)
	{
		cout<<"A()"<<endl;
	}

	A(A& a):m1_(a.m1_),m2_(a.m2_)
	{
		cout<<"A(A& a)"<<endl;
	}

	A(A&& a):m1_(a.m1_),m2_(a.m2_)
	{
		cout<<"A(A&& a)"<<endl;
	}
	~A()
	{
		cout<<"~A()"<<endl;
	}
	A& operator=(A& a)
	{
		cout<<"operator=(A&)"<<endl;
		return *this;
	}
	A& operator=(A&& a)
	{
		cout<<"operator=(A&&)"<<endl;
		this->m1_ = a.m1_;
		this->m2_ = a.m2_;
		return *this;
	}
	int m1_;
	double m2_;
};

A test1(A& aa)
{
	cout<<"----test1----"<<endl;
	A a;
	a = aa;
	return a;
}

A test2(A& aa)
{
	cout<<"----test2----"<<endl;
	return A(aa);
}

int main()
{
	A aa(100,3.14);
	A a1 = test1(aa);
	A b1 = test2(aa);
	cout<<"----------------------------"<<endl;
	A a2;
	a2 = test1(aa);
	A b2;
	b2 = test2(aa);
	cout<<"----------------------------"<<endl;
	return 0;
}
